<?php

global $CFG;
require_once($CFG->libdir.'/formslib.php');

class ext_etexts_edit_form extends moodleform {

	function definition() {

		$mform    =& $this->_form;

//-------------------------------------------------------------------------------
        // Add General box
        $mform->addElement('header', 'general', get_string('general', 'form'));

        // Add etext course-presentation text box
        $mform->addElement('text', 'coursepres', get_string('field_coursepres', 'resourcepage_etexts', NULL, dirname(__FILE__).'/lang/'));
        $mform->setType('coursepres', PARAM_TEXT);
        $mform->setHelpButton('coursepres', array('coursepres', get_string('coursepres', 'resourcepage_etexts', NULL, dirname(__FILE__).'/lang/'), 'resourcepage_etexts'));

        // Add virtual mailing option box
        $mform->addElement('advcheckbox', 'allmailings', '', get_string('field_allmailings', 'resourcepage_etexts', NULL, dirname(__FILE__).'/lang/'));
        $mform->setType('allmailings', PARAM_INT);
        $mform->setHelpButton('allmailings', array('allmailings', get_string('allmailings', 'resourcepage_etexts', NULL, dirname(__FILE__).'/lang/'), 'resourcepage_etexts'));

        // Add hidden elements
        $mform->addElement('hidden', 'id', null);
        $mform->addElement('hidden', 'placeholderitemid', null);
        $mform->addElement('hidden', 'coursemodule', null);
        $mform->addElement('hidden', 'extension', null);
        $mform->addElement('hidden', 'scrollpos', null);

//-------------------------------------------------------------------------------
        // Add Save Changes and Cancel buttons
        $this->add_action_buttons(false);
	}
}
?>